# == Schema Information
# Schema version: 8
#
# Table name: pages
#
#  id             :integer(11)   not null, primary key
#  title          :string(255)   
#  body           :text          
#  comments_count :integer(11)   default(0)
#  created_by     :integer(11)   
#  updated_by     :integer(11)   
#  created_on     :datetime      
#  updated_on     :datetime      
#  version        :integer(11)   
#

class Page < ActiveRecord::Base

  acts_as_versioned

  has_many :comments, :as => :commentable, :dependent => :destroy, :order => 'created_at ASC'
  belongs_to(:created_by, :class_name => 'User', :foreign_key => 'created_by')
  belongs_to(:updated_by, :class_name => 'User', :foreign_key => 'updated_by')
end
